<?php defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');

class DocarioViewCatusertable extends JView {
    function display($tpl=null) {
        $model = $this->getModel();
        
        $category_id = JRequest::getVar('category_id');
        $search = JRequest::getVar('search');
       
        $users = $model->getJUsersCategory($category_id, $search);
        
        foreach($users as $user) {
            if ($user->read == 0) $user->css_read = 'upermin';
            else if ($user->read == 1) $user->css_read = 'upermon';
            else if (($user->read == 2) or ($user->read == '')) 
                $user->css_read = 'upermoff';
            
            if ($user->write == 0) $user->css_write = 'upermin';
            else if ($user->write == 1) $user->css_write = 'upermon';
            else if (($user->write == 2) or ($user->css_write = '')) 
                $user->css_write = 'upermoff';
        }
        
        $this->assignRef('users', $users);
        
        parent::display($tpl);
    }
}
?>
